package week10;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

class Account{
	private int balance;
	 private static Lock lock = new ReentrantLock();
	    

	
	void deposit(int money){
		    lock.lock();
			balance=balance+money;
		    lock.unlock();
		
		
	
	}
	void withdraw(int money){
		lock.lock();
		balance=balance-money;
	    lock.unlock();
	
	
	}
	public int getBalance() {
		return balance;
	}
	public void setBalance(int balance) {
		this.balance = balance;
	}
	
}
public class ptahanshu04 {

}
